﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VK.Casemeet.Lines
{
    public class SearchUrlEntity
    {
        private int _desPro = 0;
        /// <summary>
        /// 目的地省
        /// </summary>
        public int desPro
        {
            set { _desPro = value; }
            get { return _desPro; }
        }

        private int _staPro = 0;
        /// <summary>
        /// 集结地省
        /// </summary>
        public int staPro
        {
            set { _staPro = value; }
            get { return _staPro; }
        }

        private int _type = 0;
        /// <summary>
        /// 活动类型
        /// </summary>
        public int type
        {
            set { _type = value; }
            get { return _type; }
        }

        private string _minday = string.Empty;
        public string minday
        {
            set { _minday = value; }
            get { return _minday; }
        }

        private string _maxday = string.Empty;
        public string maxday
        {
            set { _maxday = value; }
            get { return _maxday; }
        }

        private int _mon = 0;
        /// <summary>
        /// 出行月份
        /// </summary>
        public int mon
        {
            set { _mon = value; }
            get { return _mon; }
        }

        private int _holi = 0;
        /// <summary>
        /// 节日
        /// </summary>
        public int holi
        {
            set { _holi = value; }
            get { return _holi; }
        }

        private int _stay = 0;
        /// <summary>
        /// 住宿方式
        /// </summary>
        public int stay
        {
            set { _stay = value; }
            get { return _stay; }
        }

        private string _minpirce = string.Empty;
        public string minprice
        {
            set { _minpirce = value; }
            get { return _minpirce; }
        }

        private string _maxpirce = string.Empty;
        public string maxpirce
        {
            set { _maxpirce = value; }
            get { return _maxpirce; }
        }

        private int _grade = 0;
        /// <summary>
        /// 活动分级
        /// </summary>
        public int grade
        {
            set { _grade = value; }
            get { return _grade; }
        }

        private int _sort = 1;
        /// <summary>
        /// 排序方法
        /// </summary>
        public int sort
        {
            set { _sort = value; }
            get { return _sort; }
        }

        private string _path = "/LineList.html";
        /// <summary>
        /// 相对路径
        /// </summary>
        public string path
        {
            set { _path = value; }
            get { return _path; }
        }

        public string ToUrlString()
        {
            StringBuilder urlhtml = new StringBuilder();

            urlhtml.Append(_path)
                .Append("?desPro=").Append(_desPro)
                .Append("&staPro=").Append(_staPro)
                .Append("&type=").Append(_type)
                .Append("&day=").Append(_minday).Append("-").Append(_maxday)
                .Append("&mon=").Append(_mon)
                .Append("&holi=").Append(_holi)
                .Append("&stay=").Append(_stay)
                .Append("&price=").Append(_minpirce).Append("-").Append(_maxpirce)
                .Append("&grade=").Append(_grade)
                .Append("&sort=").Append(_sort);

            return urlhtml.ToString();
        }

        /// <summary>
        /// 复制对象
        /// </summary>
        /// <returns>返回它本身的一个副本</returns>
        public object GetCopy()
        {
            return MemberwiseClone();
        }
    }
}
